﻿@using Covenant.Models.Listeners
@model IEnumerable<HostedFile>
@{
    HttpListener Listener = ViewBag.Listener;
}

<div class="table-responsive">
    <table id="hostedfile-table" class="table table-hover">
        <thead>
            <tr>
                <th>@Html.DisplayNameFor(model => model.Path)</th>
                <th>Download</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Path)
                    </td>
                    <td>
                        <a asp-controller="HostedFile" asp-action="Download" asp-route-id="@item.Id" class="btn btn-primary">
                            <span data-feather="download"></span> 
                            Download
                        </a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
<a asp-controller="HostedFile" asp-action="Create" asp-route-id="@Listener.Id" class="btn btn-primary">
    <span data-feather="plus"></span>
    Create
</a>